import core from 'gapi/core'

class socialApi extends core{
	/**
	 * 保存二维码到本地相册
	 */
	downloadQRCodeImage (qrcodeurl, callBack){
		this.sendData({
			method: 'downloadQRCodeImage',
			param: {
				qrcodeurl: qrcodeurl
			},
			callBack: callBack
		});
	}
    /**
	 * 微信分享(用于添加人员[二维码邀请分享到微信 & 微信邀请])
	 */
	shareQRCode (qrcodeurl, callBack){
		this.sendData({
			method: 'shareQRCode',
			param: {
				qrcodeurl: qrcodeurl
			},
			callBack: callBack
		});
	} 

	shareKQTask(data){
		this.sendData({
			method: 'shareKQTask', 
			param:{
                title: data.title,
                text: data.text,
                logo: data.logo,
                url: data.url
            } 
		})
	}
	weiXinShare (data){
		this.sendData({
			method: 'weiXinShare', 
			param:{
                title: data.title,
                text: data.text,
                logo: data.logo,
                url: data.url,
                type:data.type,
                tId: data.tId,
                pId: data.pId,
                gId: data.gId,
                viewType: data.viewType,
                code: data.code,
                groupName: data.groupName
            } 
		})
	}

	/**
	 * 导出考勤数据、导出签到数据、导出数据上报数据  调用分享接口

	 	type: 考勤 1，签到 2，数据上报 3
	 	data: {}
	 */
	exportDataFileAndShare(type, data){
		this.sendData({
			method: 'exportDataFileAndShare', 
			param:{
                type: type,
                data: data
            } 
		})
	}

	// 面对面邀请（微信）
	faceToFaceShare (data){
		console.log(data)
		this.sendData({
			method: 'faceToFaceShare', 
			param:{
                team_id: data.tId,
                project_id: data.pId,
                group_id: data.gId
            }
		})
	}


	// 电子合同PDF下载（安卓）
	protocolShare (data){
		console.log(data)
		this.sendData({
			method: 'protocolShare', 
			param:{
                file_name: data.file_name,
                download_url: data.download_url
            }
		})
	}

	

}

export default new socialApi({
	name: 'socialApi',
	author: 'huochunyang1@doumi.com',
	version: '2.0',
	jsbc: jsBridgeClient,
	// nativeCls 一定要和客户端的同学对应
	nativeCls: 'socialApi'
})
